﻿<base:ControlBase xmlns:base="clr-namespace:Rio.Framework.Pages"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                  xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                  xmlns:System="clr-namespace:System;assembly=mscorlib" 
                  x:Name="controlBase" 
                  x:Class="Rio.Framework.Pages.Controls.DocumentInformations"
                  mc:Ignorable="d"
                  d:DesignHeight="300" 
                  d:DesignWidth="300">

    <Grid x:Name="LayoutRoot"
          HorizontalAlignment="Stretch"
          VerticalAlignment="Stretch">
    	<VisualStateManager.VisualStateGroups>
    		<VisualStateGroup x:Name="VisualStateGroup">
    			<VisualState x:Name="NoData">
    				<Storyboard>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="textboxAuthor">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<System:Boolean>False</System:Boolean>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="textboxCreditPhoto">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<System:Boolean>False</System:Boolean>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="textboxNote">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>False</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="buttonUpdateDocument">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<System:Boolean>False</System:Boolean>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
         
    			<VisualState x:Name="Default">
    				<Storyboard>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="textboxAuthor">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<System:Boolean>True</System:Boolean>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="textboxCreditPhoto">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<System:Boolean>True</System:Boolean>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="textboxNote">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>                        
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="buttonUpdateDocument">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<System:Boolean>True</System:Boolean>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
        <Grid.ColumnDefinitions>
        	<ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
        	<RowDefinition Height="Auto"/>
        	<RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        	<RowDefinition Height="Auto" />
        	<RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        	<RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto" />
        	<RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <TextBlock x:Name="labelAuthor"
                    Grid.Row="0"
                    HorizontalAlignment="Left" 
                   Text="{Binding AuthorLabel, ElementName=controlBase}" VerticalAlignment="Center" />

        <TextBox x:Name="textboxAuthor"
                 Grid.Row="1"
                 Margin="2"
                 HorizontalAlignment="Stretch"
                 VerticalAlignment="Center"
                 MaxLength="50" 
                 Text="{Binding Author, ElementName=controlBase, Mode=TwoWay}" />


        <TextBlock x:Name="labelCreditPhoto"
                    Grid.Row="2"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center" 
                   Text="{Binding CreditPhotoLabel, ElementName=controlBase}" />

        <TextBox x:Name="textboxCreditPhoto"
                Grid.Row="3"
                Margin="2"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Center"
                IsReadOnly="True"
                MaxLength="50" 
                 Text="{Binding CreditPhoto, ElementName=controlBase, Mode=TwoWay}" />

        <TextBlock x:Name="labelNote"
                   Grid.Row="4"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Text="{Binding NoteLabel, ElementName=controlBase}" />
       
        <TextBox x:Name="textboxNote"
                 Grid.Row="5"
                 Margin="2"
                 HorizontalAlignment="Stretch"
                 VerticalAlignment="Center"
                 TextWrapping="Wrap"
                 HorizontalScrollBarVisibility="Auto"
                 VerticalScrollBarVisibility="Auto"
                 AcceptsReturn="True"
                 MaxLength="1024" 
                 Text="{Binding Note, ElementName=controlBase, Mode=TwoWay}" Height="50" />

        <telerik:RadButton x:Name="buttonUpdateDocument"
                           Grid.Row="6"
                           Margin="2,2,5,10"
                           HorizontalAlignment="Right"
                           Command="{Binding UpdateDocumentInformationCommand, ElementName=controlBase}" 
                           CommandParameter="{Binding}"
                           Height="25">

            <StackPanel Orientation="Horizontal">
                <Image Width="16"
                       HorizontalAlignment="Left"
                       Height="16"
                       Margin="0,0,2,0"
                       Source="/Rio.Framework.Pages;component/Assets/Images/UpdateDocument.png" />
                <TextBlock x:Name="TextBlockToSearch" 
                           VerticalAlignment="Center" 
                           Text="Modifier" FontWeight="Bold" />
            </StackPanel>

        </telerik:RadButton>

        <TextBlock x:Name="labelStateHistory"
                                   Grid.Row="7"
                                   HorizontalAlignment="Left"
                                   VerticalAlignment="Top" Text="{Binding StateHistoLabel, ElementName=controlBase}" />
        <ScrollViewer Background="#EEEEEE"
                                      BorderBrush="Black"
                                      BorderThickness="1"
                                      Grid.Row="8"
                                      HorizontalAlignment="Stretch" Margin="2,0">
        	<TextBlock x:Name="StateHistory" Text="{Binding StateHisto, ElementName=controlBase, Mode=TwoWay}" Height="80" />
        </ScrollViewer>
    </Grid>
</base:ControlBase>
